#ifndef _5A952E53_E9FF_4353_B734_9842FCC1516C_INCLUDE_
#define _5A952E53_E9FF_4353_B734_9842FCC1516C_INCLUDE_
#include "../../Utils/Utils.h"
#pragma once
/*
Author: Shakti Prasad Misra
License: GPL2
Revesion: 0.1v
All usage of this file is permitted, for free software or commercial. 
But the Author name should not be changed. If changes are done please add it to the changed section.
*/
#define AUTHOR "Shakti Misra"
#define LICENSE "GPL2"

namespace tng//Namespace for 
{

//Class TreeNode start
template <typename keyValType,
typename dataType,
typename traits,
unsigned long int maxKeys,
unsigned long int maxNodes = maxKeys + 2>
class TreeNode
{
private:
    static bool _deleteData;

public:
    traits _traits;
    dataType* _data;
    TreeNode<keyValType, dataType, traits, maxKeys, maxNodes>* _nodes[maxNodes];
    keyValType _keyVal[maxKeys];

public:
    TreeNode(dataType* data = NULL, bool deleteData = false):_data(data), _deleteData(deleteData)
    {
        memset(_nodes, 0x00, sizeof(_nodes[maxNodes]));
    }

    void setKeyVal(keyValType* keval)
    {
        memcpy(_keyVal, keval, sizeof(keval[maxNodes]));
    }

    traits getTraits()
    {
        return _traits;
    }

    traits setTraits(traits& newTrait)
    {
        traits ret = _traits;
        _traits = newTrait;
        return _traits;
    }

    dataType* modifyData(dataType* newData)
    {
        dataType* ret = _data;
        _data = newData;
        return ret;
    }

    dataType* getData()
    {
        return _data;
    }

    void setDeleteData(bool val = true)
    {
    }

    ~TreeNode()
    {
        if(true == _deleteData)
        {
            delete _data;
        }
        _data = NULL;
    }
};
//Class TreeNode end

}//namespace BT end
#endif //_5A952E53_E9FF_4353_B734_9842FCC1516C_INCLUDE_
